for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import { Request } from 'express';
@Injectable()
export class IsAuthenticatedGuard implements CanActivate {
canActivate(context: ExecutionContext): boolean {
const req = context.switchToHttp().getRequest() as Request;
return !!req.user;
}